<font size="" color=""><!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
		<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js">
		</script>
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=VeNlX17jPLxeiO4BzoL5rb1nyULo4LA9"></script>
        <script type="text/javascript" src="http://api.map.baidu.com/library/Heatmap/2.0/src/Heatmap_min.js"></script>
        <title>热力图功能示例</title>
        <style type="text/css">
            ul,li{list-style: none;margin:0;padding:0;float:left;}
            html{height:100%}
            body{height:100%;margin:0px;padding:0px;font-family:"微软雅黑";}
            #container{height:100%;width:100%;}
            #r-result{width:100%;}
        </style>	
    </head>
    <body>
        <div id="container"></div>
    </body>
    </html>
    <script type="text/javascript">
		document.addEventListener('UniAppJSBridgeReady', function() {
			var mood = plus.storage.getItem('heatMood');
			mood = JSON.parse(mood)
			
			var addalt = plus.storage.getItem('heatMoodadd');
			addalt = JSON.parse(addalt)
			//console.log(plus.storage.getItem('heatMoodadd'))
			// 创建地图实例
			var map = new BMap.Map("container");         
			//设置地图的中心点
			var point = new BMap.Point(addalt.lng,addalt.lat);
			 // 初始化地图，设置中心点坐标和地图级别
			map.centerAndZoom(point, 10);  
			// 允许滚轮缩放
			map.enableScrollWheelZoom(); 
			//设置热力图的点参数
			var points =mood
			//判断浏览器是否支持canvas
			if(!isSupportCanvas()){alert('热力图目前只支持有canvas支持的浏览器,您所使用的浏览器不能使用热力图功能~')}
			//热力图初始化
			heatmapOverlay1 = new BMapLib.HeatmapOverlay({"radius":20});
			//地图添加热力图层
			map.addOverlay(heatmapOverlay1);
			//热力图层添加数据
			heatmapOverlay1.setDataSet({data:points,max:30});
			heatmapOverlay1.show();
			//不知道作用
			//判断浏览区是否支持canvas
			function isSupportCanvas(){
			    var elem = document.createElement('canvas');
			    return !!(elem.getContext && elem.getContext('2d'));
			}
			ismsg()
			function ismsg(){
				let gc = new BMap.Geocoder();
				gc.getLocation(point, function(rs){
				   let address = rs.address
				   uni.postMessage({
				   	data: {
				   		address: address
				   	}
				   });
				});
			}
		})
      
      
    </script></font>
